<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>登录页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link th:href="@{/moyue/css/bootstrap.min.css}" rel="stylesheet"/>
    <link th:href="@{/moyue/css/denglu.css}"  rel="stylesheet">
    <link th:href="@{/moyue/font-awesome-4.7.0/css/font-awesome.min.css}" rel="stylesheet">
    <link rel="shortcut icon" th:href="@{/moyue/images/favicon.ico}" type="image/x-icon"/>
</head>
<body>
    <img class="bg" src="/moyue/Path/upload/bgimg/denglu.jpg"/>
    <div class="login">0.
        <div class="yonghu">           
            <img src="/moyue/Path/upload/bgimg/bb.png">
        </div>
        <h2>登录</h2>
        <div class="user">
            <i class="fa fa-user" style="font-size: 30px;color:#fff;"></i>
            <input id="user" type="text" placeholder="User">
        </div>
        <div class="user">
            <i class="fa fa-unlock-alt" style="font-size: 30px;color:#fff;"></i>
            <input  id="password"  type="password" placeholder="password">
        </div>
        <a id="deng" ><div class="goto">登录</div></a>
    </div>
</body>
<script th:src="@{/moyue/js/jquery-3.3.1.min.js}"></script>
<script th:src="@{/moyue/js/bootstrap.min.js}"></script>
<script th:inline="javascript" >
    $('#deng').on('click',function () {
        $.ajax({
            type: "POST",//数据发送的方式（post 或者 get）
            url: "/moyue/login/loginUI",//要发送的后台地址
            data: {
                identity: $('#user').val(),
                certificate: $('#password').val(),
            },//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
            dataType: "JSON",
            success: function (data) {//ajax请求成功后触发的方法
                if (data.code == 1) {
                     location="/moyue/admin/bms/?page=1";
                }else{

                }
            },
            error: function (msg) {//ajax请求失败后触发的方法
                alert("网络故障");//弹出错误信息
            }
        });
    })

</script>
</html>